A macro defines the action that results when an interface element is selected. A macro accomplishes a drawing task that would otherwise take a series of actions by a user.
You can use special characters, including control characters, in macros. In a macro, the caret (^) is equivalent to pressing the Ctrl key on the keyboard. You can combine the caret with another character to construct macros that do such things as turn the grid on and off (^G) or cancel a command (^C).
To accept input from the keyboard or pointing device in the middle of a command, place a backslash (\) in the macro at the point where you want input.
To develop menus that can be used with a non-English-language version of AutoCAD, precede each command or option with the underscore character (_). The underscore character allows the standard commands and options to be translated automatically.
To develop macros that use built-in commands that are part of AutoCAD, precede each command with the period character (.). The period character allows the built-in command to be used even if it has been undefined with the UNDEFINE command making the macro predicable when it is used on other systems that share the same customization file.
You can use a leading asterisk (*) to repeat a command in a macro until you choose another command.
Single Object Selection mode cancels the normal repetition of the Select Objects prompt in editing commands. After you select one object and respond to any other prompts, the command ends.
You can replace the contents of active menus, mouse buttons, tablet buttons, tablet menus, or screen menus. The swapped content can be that of another user interface element of the same type in the main CUIx file, or it can come from a partial CUIx file.
You can add conditional expressions to a macro by using a command that introduces macro expressions written in DIESEL (Direct Interpretively Evaluated String Expression Language).
Creating commands that use AutoLISP is a more advanced way to use the AutoCAD customization feature.